Skip to content

Conversation

@fkrause98
Copy link
Collaborator

@fkrause98 fkrause98 commented Dec 3, 2025

Description:

Related issue: #1563.

There's a (currently open) PR for miden-node that unifies the "GetAccountDetails" and "GetAccountProofs endpoints" into a single endpoint "GetAccount". The goal of this PR is to adapt to said new endpoint, while preserving the actual NodeRpcClient trait API.

We will probably have to wait for said PR to be merged to be merged. Since I've encountered some versioning issues while working with this, so I'm currently using a local setup for this to work.

Also, something important is that the new protobuf structures have changed quite a bit, so there are probably some
parameters I might've missed or that we should decide on how to handle them.

Tasks Left:

  • Update get_account_details trait method.
  • Properly test the new account retrieval works.
  • Maybe test what happens when we have to retrieve a really big state

@fkrause98 fkrause98 requested review from SantiagoPittella and igamigo and removed request for igamigo January 7, 2026 16:17
@fkrause98 fkrause98 marked this pull request as ready for review January 7, 2026 16:17
@fkrause98 fkrause98 added no changelog This PR does not require an entry in the `CHANGELOG.md` file and removed no changelog This PR does not require an entry in the `CHANGELOG.md` file labels Jan 7, 2026
}
}

#[cfg(feature = "tonic")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? It does not seem to be needed in any of the other conversions

Comment on lines +400 to +402
// Builds an account that triggers the "too_many_assets" boolean
// flag when requested from the node.
fn build_test_faucets_and_account() -> anyhow::Result<Vec<Account>> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, would be great to break this function into smaller ones to make this more readable. Alternatively (or maybe as a complement), would be great to add small comments within the function

Comment on lines +108 to +110
/// Given an id, return the proof for the account.
/// If the account also has public state, the details for it
/// will also be retrieve as part of the proof.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Given an id, return the proof for the account.
/// If the account also has public state, the details for it
/// will also be retrieve as part of the proof.
/// Given an [`AccountId`], return the proof for the account.
///
/// If the account also has public state, the details for it will also be retrieved as part of
/// the proof.

info
} else {
let fetched_data =
self.sync_storage_maps(0_u32.into(), None, account_id).await?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need to implement pagination in GrpcClient::sync_storage_maps and GrpcClient::sync_storage_vaults, right?

Comment on lines +68 to +71
// Helper function to request extra details for an account.
// Keep in mind, this can potentially do **two** requests to the rpc endpoint.
// If the account has a non public state, it will simply return the first response.
// Otherwise it will request the RPC endpoint for the extra data for an account with public state.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments look misplaced

// Keep in mind, this can potentially do **two** requests to the rpc endpoint.
// If the account has a non public state, it will simply return the first response.
// Otherwise it will request the RPC endpoint for the extra data for an account with public state.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

.get_account_proof(account_request)
.await
.map_err(|status| {
RpcError::from_grpc_error(NodeRpcClientEndpoint::GetAccountDetails, status)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be renamed to something like NodeRpcClientEndpoint::GetAccount or something like that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants